import 'package:backend.core/core/domain/entities/api/google_play/api_google_play_transaction_revocation_source.dart';
import 'package:backend.core/core/domain/entities/google_play/google_play_transaction_revocation_source.dart';

abstract class CreateApiGooglePlayTransactionRevocationSourceFromInternalOne {
  ApiGooglePlayTransactionRevocationSource call({
    required GooglePlayTransactionRevocationSource source,
  });
}

class CreateApiGooglePlayTransactionRevocationSourceFromInternalOneImpl
    implements CreateApiGooglePlayTransactionRevocationSourceFromInternalOne {
  const CreateApiGooglePlayTransactionRevocationSourceFromInternalOneImpl();

  @override
  ApiGooglePlayTransactionRevocationSource call({
    required GooglePlayTransactionRevocationSource source,
  }) {
    switch (source) {
      case GooglePlayTransactionRevocationSource.user:
        return ApiGooglePlayTransactionRevocationSource.user;
      case GooglePlayTransactionRevocationSource.developer:
        return ApiGooglePlayTransactionRevocationSource.developer;
      case GooglePlayTransactionRevocationSource.google:
        return ApiGooglePlayTransactionRevocationSource.google;
    }
  }
}
